setClass("SumBFrameworkFinalResult",contains="VBFrameworkFinalResult",
		
		prototype=prototype(
				.description="Sum  Bootstrap Framework Final Result computer class"
		)

)  


#initialization method 
setMethod("initialize",
		signature="SumBFrameworkFinalResult",
		function(.Object,hTester,...){
			.Object<-callNextMethod(.Object,...)
			return(.Object)
		})


setMethod("computeBFResult",
		signature="SumBFrameworkFinalResult",
		definition=function(.Object,inputList,...){
			#check inputList format
			callNextMethod(.Object,inputList,...)

			listLength <- length(inputList)
			
			crNames <- unlist( lapply(1:listLength,FUN=function(n,list){
								rownames(list[[n]])
							} ,inputList))
			
			sumMatrices <- matrix(unlist( lapply(1:listLength,FUN=function(n,list){
								mean(list[[n]])
							} ,inputList)),nrow=listLength )
			
			rownames(sumMatrices) <-crNames
			
			return(list(AVGS=sumMatrices,OrgData=inputList))
		}
)  


